package cn.com.ejiakanghu.dto;

import org.springframework.core.style.StylerUtils;

public enum EnumGoodsType {
    NONE("none", ""),
    LEASE("lease", "租赁"),
    SALE("sale", "销售");

    private String goodsType;
    private String typeName;

    EnumGoodsType(String goodsType, String typeName) {
        this.goodsType = goodsType;
        this.typeName = typeName;
    }

    public String getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(String goodsType) {
        this.goodsType = goodsType;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public static String getTypeNameByType(String type) {
        EnumGoodsType[] goodsTypes = EnumGoodsType.values();
        for(EnumGoodsType t:goodsTypes) {
            if(t.getGoodsType().equals(type)) {
                return t.getTypeName();
            }
        }
        return null;
    }
}
